package de.itagile.hypersphere

import de.itagile.hypersphere.EjbJarXmlParserclass EjbJarXmlParserTest extends GroovyTestCase {
	
	def xml = 
		'''
			<entity id="Book">
				<ejb-name>Book</ejb-name>
				<local-home>ejbs.BookLocalHome</local-home>
				<cmp-field id="CMPAttribute_1198159932479">
					<field-name>id</field-name>
				</cmp-field>
			</entity>
		'''
	
	void testRemovesDashesInTags() {
		def entity = new EjbJarXmlParser().parseText(xml)
		assertEquals("Book", entity.ejbname.text())
		assertEquals("CMPAttribute_1198159932479", entity.cmpfield[0].'@id')
		assertEquals("ejbs.BookLocalHome", entity.localhome.text())
	}
}